
#include "dynamicnameproxy.h"

#include <QtDBus>

DynamicNameProxy::DynamicNameProxy(QObject* parent)
  : QObject(parent)
{
  QDBusConnection dbus = QDBusConnection::sessionBus();

  m_iface = new com::kdab::DynamicName( "com.kdab.DynamicName", "/DynamicName", dbus, this);
  connect(m_iface, SIGNAL(nameChanged()), SIGNAL(nameChanged()));
}

QString DynamicNameProxy::name() const
{
  return m_iface->name();
}

void DynamicNameProxy::setName(const QString& name)
{
  if (name == m_iface->name())
    return;

  m_iface->setName(name);
  emit nameChanged();
}

